import { useQuasar } from 'quasar'

export function useMessageNotify () {
  let $q = useQuasar();

  //普通消息提示
  const showMessage = (msg: string) => {
    $q.notify({
      message: msg,
      icon: 'announcement'
    })
  }

  //操作失败提示
  const showErrorMessage = (msg: string) => {
    $q.notify({
      color: 'negative',
      message: `${msg}操作失败！`,
      icon: 'mdi-alert-circle'
    })
  }

  //操作成功提示
  const showSuccessMessage = (msg: string) => {
    $q.notify({
      color: 'primary',
      message: `${msg}操作成功！`,
      icon: 'mdi-check-circle'
    })
  }


  return {
    showMessage,
    showErrorMessage,
    showSuccessMessage
  };
}
